package 壁画;

import java.util.Scanner;

public class Main {
    static int N = 5000010;
    static char[] ch = new char[N];
    static int[] s = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        for (int cases = 1; cases <= T; cases++) {
            int n = in.nextInt();
            ch = in.next().toCharArray();
            for (int i = 1; i <= n; i++) {
                s[i] = s[i - 1] + ch[i-1] - '0';
            }
            int k = (n + 1) / 2;
            int res = 0;
            for (int i = k; i <= n; i++) {
                res = Math.max(res, s[i] - s[i - k]);
            }
            System.out.printf("Case #%d: %d\n", cases, res);
        }
    }
}